package junior.db.query;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class PageVO<T> implements Serializable {
	private static final long serialVersionUID = -3964460144356232452L;
	private long total;
	private long totalPages;
	private List<T> list;
	
	@SuppressWarnings("unchecked")
	public PageVO() {
		this(0, new ArrayList<>());
	}
	
	public PageVO(long total, List<T> list) {
		this.total = total;
		this.list = list;
	}
	public PageVO(long total, long totalPages, List<T> list) {
		this.total = total;
		this.totalPages = totalPages;
		this.list = list;
	}
	public long getTotal() {
		return total;
	}
	public void setTotal(long total) {
		this.total = total;
	}
	public List<T> getList() {
		return (List<T>) list;
	}
	public void setList(List<T> list) {
		this.list = list;
	}
	public long getTotalPages() {
		return totalPages;
	}
	public void setTotalPages(long totalPages) {
		this.totalPages = totalPages;
	}
}
